// @ts-nocheck
import { defineStore } from 'pinia'
export const userStore = defineStore('userInfo', {
  // 为了完整类型推理，推荐使用箭头函数
  state: () => {
    return {
      // 所有这些属性都将自动推断出它们的类型
      name: '',
      token: '',
      role: '',
      avatar: ''
    }
  },
  actions: {
    setUserInfo(name: string, token: string, role: string, avatar: string = '') {
      this.name = name
      this.token = token
      this.role = role
      this.avatar = avatar
    }
  },
  persist: {
    enabled: true
  }
})
